package cn.edu.gduf.luowowo.search.service.impl;

import cn.edu.gduf.luowowo.search.domain.DestinationTemplate;
import cn.edu.gduf.luowowo.search.repository.DestinationSearchRepository;
import cn.edu.gduf.luowowo.search.service.IDestinationSearchService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;

@Service
public class DestinationSearchServiceImpl implements IDestinationSearchService {
    @Autowired
    private DestinationSearchRepository repository;
    @Autowired
    private ElasticsearchTemplate template;

    @Override
    public void saveOrUpdate(DestinationTemplate template) {
        repository.save(template);
    }

    @Override
    public DestinationTemplate getDestByDestName(String destName) {
        return repository.findByName(destName);
    }
}
